Skip to content

Remove Snapshooter and ChilliCream.Testing.Utilities#9794

Merged
glen-84 merged 3 commits into
mainfrom
gai/remove-snapshooter-and-chillicream-testing
May 28, 2026
Merged

Remove Snapshooter and ChilliCream.Testing.Utilities#9794
glen-84 merged 3 commits into
mainfrom
gai/remove-snapshooter-and-chillicream-testing

Conversation

@glen-84
Copy link
Copy Markdown
Member

@glen-84 glen-84 commented May 28, 2026

Summary

  • Drops the last Snapshooter.Xunit and ChilliCream.Testing.Utilities users from the repo (StrawberryShake CodeGeneration tests) in favor of CookieCrumble, which already powers ~99% of the snapshot suite.
  • Reworks GeneratorTestHelper to use [CallerFilePath] and a small inline file-snapshot helper, replacing the Snapshooter-specific SnapshotFullName + custom-path MatchSnapshot mechanic that has no direct CookieCrumble equivalent.
  • Removes both PackageVersion entries from Directory.Packages.props and the corresponding PackageReferences from CodeGeneration/test/Directory.Build.props; wires up CookieCrumble.Xunit + CookieCrumble.Analyzers via ProjectReference matching the convention used by HotChocolate/Core/test and StrawberryShake/Client/test.

Test plan

  • dotnet build src/StrawberryShake/CodeGeneration/StrawberryShake.CodeGeneration.slnx
  • dotnet test src/StrawberryShake/CodeGeneration/test/CodeGeneration.Tests — 29 passed, 1 skipped
  • dotnet test src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests — 188 passed, 1 skipped
  • dotnet test src/StrawberryShake/CodeGeneration/test/CodeGeneration.Razor.Tests — 1 passed

Copilot AI review requested due to automatic review settings May 28, 2026 16:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the remaining usages of Snapshooter.Xunit and ChilliCream.Testing.Utilities from StrawberryShake CodeGeneration tests by standardizing on CookieCrumble (already used broadly in the repo), and updates test infrastructure accordingly.

Changes:

  • Replaces Snapshooter/ChilliCream testing utilities with CookieCrumble across CodeGeneration test projects (global usings + references, updated imports).
  • Reworks GeneratorTestHelper integration snapshot path logic to rely on [CallerFilePath] and a custom “match snapshot at path” helper.
  • Removes Snapshooter.Xunit / ChilliCream.Testing.Utilities package versions from central package management and cleans up a snapshot file encoding artifact (BOM).

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/StrawberryShake/CodeGeneration/test/Directory.Build.props Switches test dependencies to CookieCrumble project refs and adds a compile exclude for __mismatch__ artifacts.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.Tests/Utilities/SchemaHelperTests.cs Removes ChilliCream.Testing import.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.Tests/Utilities/QueryDocumentRewriterTests.cs Removes Snapshooter.Xunit import.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.Tests/Utilities/OperationDocumentHelperTests.cs Switches FileResource static import from ChilliCream to CookieCrumble.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.Tests/Mappers/TestDataHelper.cs Switches FileResource static import from ChilliCream to CookieCrumble.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.Razor.Tests/GeneratorTestHelper.cs Removes Snapshooter usage and adds a custom path-based snapshot matcher using [CallerFilePath].
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/StarWarsGeneratorTests.cs Removes ChilliCream.Testing import.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/SchemaGeneratorTests.cs Removes ChilliCream.Testing import.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/ScalarGeneratorTests.cs Removes ChilliCream.Testing import.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/OperationGeneratorTests.cs Removes ChilliCream.Testing import.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/NoStoreStarWarsGeneratorTests.cs Removes ChilliCream.Testing import.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/TestGeneration.cs Removes ChilliCream.Testing import.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsUnionListTest.cs Removes Snapshooter.Xunit import.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsTypeNameOnUnionsTest.cs Removes Snapshooter.Xunit import.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsTypeNameOnInterfacesTest.cs Removes Snapshooter.Xunit import.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsIntrospectionTest.cs Removes Snapshooter.Xunit import.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/EntityIdOrDataTest.cs Removes Snapshooter.Xunit import.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/AnyScalarDefaultSerializationTest.cs Removes Snapshooter.Xunit import.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/snapshots/StarWarsIntrospectionTest.Execute_StarWarsIntrospection_Test.snap Removes BOM/normalizes snapshot file start/end formatting.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/InputGeneratorTests.cs Removes ChilliCream.Testing import.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/GeneratorTestHelper.cs Removes Snapshooter usage and adds a custom path-based snapshot matcher using [CallerFilePath].
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/ErrorGeneratorTests.cs Removes ChilliCream.Testing import.
src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/EntityGeneratorTests.cs Removes ChilliCream.Testing import.
src/StrawberryShake/Client/test/Core.Tests/Integration/Mappers/DroidHeroMapper.cs Switches from ChilliCream.Testing to CookieCrumble import (currently unused).
src/StrawberryShake/Client/test/Core.Tests/Integration/IntegrationTests.cs Switches from ChilliCream.Testing to CookieCrumble import (for FileResource).
src/Directory.Packages.props Removes central package versions for Snapshooter.Xunit and ChilliCream.Testing.Utilities.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/StrawberryShake/Client/test/Core.Tests/Integration/Mappers/DroidHeroMapper.cs Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.

@glen-84 glen-84 merged commit 13f47b6 into main May 28, 2026
144 checks passed
@glen-84 glen-84 deleted the gai/remove-snapshooter-and-chillicream-testing branch May 28, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants